package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.bac.PurposeDto;
import com.ysd.lis.request.bac.PurposeParam;
import com.ysd.lis.service.bac.BacReqPurposeDetailService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-04-11
 */
@RestController
@RequestMapping("/api/bac/bacReqPurposeDetail")
public class BacReqPurposeDetailController extends BaseController {

    @Autowired
    BacReqPurposeDetailService bacReqPurposeDetailService;
    @ApiOperation("查询")
    @GetMapping("/findPurposeDetailList")
    public Result findPurposeDetailList(PurposeParam param){
        return bacReqPurposeDetailService.findPurposeDetailList(param);
    }

    @ApiOperation("修改")
    @PostMapping("/saveOrUpdatePurposeDetail")
    public Result saveOrUpdatePurposeDetail(@RequestBody PurposeDto dto) {
        return bacReqPurposeDetailService.saveOrUpdatePurposeDetail(dto);
    }
    @ApiOperation("修改")
    @PostMapping("/updatePurposeAndDetail")
    public Result updatePurposeAndDetail(@RequestBody PurposeDto dto) {
        return bacReqPurposeDetailService.updatePurposeAndDetail(dto);
    }

    @ApiOperation("批量删除")
    @PostMapping("/deleteBatchPurposeDetail")
    public Result deleteBatchPurposeDetail(@RequestBody PurposeDto dto){
        return  bacReqPurposeDetailService.deleteBatchPurposeDetail(dto);
    }

    @ApiOperation("查询")
    @GetMapping("/findPurposeAndDetailList")
    public Result findPurposeAndDetailList(PurposeParam param){
        return bacReqPurposeDetailService.findPurposeAndDetailList(param);
    }

}
